@extends('home.layout.base')
<link rel="stylesheet" href="{{URL::asset('./css/suppliermy/public.css')}}">
<link rel="stylesheet" href="{{URL::asset('./css/suppliermy/index.css')}}">
<style type="text/css">
.footprintMian>div {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(204, 204, 204, 1);
}

.footprintMian>div:last-child {
    border-bottom: 0px;
}

.footprintMian>div>img,
.footprintMian>div .itemMone {
    height: 80px;
    width: 80px;
}

.footprintMian>div .itemMone {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-family: Source Han Sans CN;
    font-weight: bold;
    color: rgba(209, 0, 24, 1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left:0;
}
.footprintMian>div .itemMone a {
    font-size: 16px;
    color: rgba(209, 0, 24, 1);
}
.footprintMian>div>button {
    width: 100px;
    height: 30px;
    background: #ffffff;
    border: 1px solid rgba(204, 204, 204, 1);
    opacity: 1;
    border-radius: 2px;
    font-size: 16px;
    font-family: Source Han Sans CN;
    font-weight: 400;
    line-height: 28px;
    color: rgba(51, 51, 51, 1);
    text-align: center;
}

.footprintMian>div>div {
    width: 690px;
    padding-left: 36px;
    padding-right: 135px;
    display: grid;
    grid-row-gap: 15px;
    align-items: center;
}
</style>
@section('content')
<div class="mainHrContent" id="supplierIndex">
    <div class="storelistTitle" id="storelistTitle" v-cloak>
        <span class="storelistTitle_left">
            <span>

                <img src="{{URL::asset('./img/icon/home.png')}}">
            </span>
            <span><a href="{{route('home.index.index') }}">首页</a> > 供应商中心</span>
        </span>
        <!-- <span class="storelistTitle_right">
            <span>找不到合适的供应商？发个需求试试？</span>
            <button @click="window.location.href ='{{ route('home.demand.demandAdd')}}'">免费发布需求</button>
        </span> -->
    </div>
    <div class="hrContent">
        @include('home.suppliermy.menu')
        <div class="hrContentRight" id="supplierIndexs" v-cloak>
            <div class="myOrder">
                <div class="myTitle">
                    <div><span></span>财务管理</div>
                    <a href="{{route('home.suppliermy.supplierAssetsInfo')}}">财务管理中心 > ></a>
                </div>
                <div class="myMesContent">
                    <div>
                        <a href="">
                            <span class="spanImg">
                                <img src="{{URL::asset('./img/icon/integral.png')}}">
                            </span>
                            <span class="spanMes">
                                <span>积分</span>
                                <span>@{{userInfo.integral}}分</span>
                            </span>
                        </a>
                    </div>
                    <div>
                        <a>
                            <img src="{{URL::asset('./img/icon/balance.png')}}">
                            <span class="spanMes">
                                <span>余额</span>
                                <span>@{{userInfo.balance}}元</span>
                            </span>
                        </a>
                    </div>
                    <div>
                        <a>
                            <img src="{{URL::asset('./img/icon/guarantee.png')}}">
                            <span class="spanMes">
                                <span>保证金</span>
                                <span>@{{userInfo.bond}}元</span>
                            </span>
                        </a>
                    </div>
                    <div>
                        <a>
                            <span class="memberMoney">
                                会
                            </span>
                            <span class="spanMes">
                                <span>会员费<span>（@{{userInfo.member_fee}}）</span></span>
                                <span v-if="userInfo.member_fee_at" style="font-weight:400;font-size:12px;">有效期：@{{userInfo.member_fee_at}}</span>
                            </span>
                        </a>
                    </div>
                    <div>
                        <a>
                            <img src="{{URL::asset('./img/icon/earnings.png')}}">
                            <span class="spanMes">
                                <span>总收益</span>
                                <span>@{{parseFloat(userInfo.profit) + parseFloat(userInfo.contract)}}元</span>
                            </span>
                        </a>
                    </div>
                    <div>
                        <a>
                            <img src="{{URL::asset('./img/icon/deposit.png')}}">
                            <span class="spanMes">
                                <span>已提现</span>
                                <span>@{{userInfo.cash}}元</span>
                            </span>
                        </a>
                    </div>
                </div>
            </div>
            <div class="myPropertys">
            <div class="myProperty">
                    <div class="myTitle">
                        <div><span></span>我的店铺</div>
                        <a href="{{route('home.suppliermy.supplierStore')}}">店铺管理中心 ></a>
                    </div>
                    <div v-if="userInfo.store_status">
                        <div class="CollectMes" v-if="userInfo.store_status==1 || userInfo.store_status == 5">
                            <!-- <a href="{{route('home.suppliermy.supplierStore')}}"> -->
                            <a>
                                <span style="color:#D10018">@{{userInfo.store_call || 0}}</span>
                                <span>致电量</span>
                            </a>
                            <a>
                                <span>@{{userInfo.store_collect || 0}}</span>
                                <span>收藏量</span>
                            </a>
                            <a>
                                <span>@{{userInfo.store_praise || 0}}%</span>
                                <span>好评</span>
                            </a>
                        </div>
                        <div class="CollectMes" v-if="userInfo.store_status==2">
                            <span>您的店铺正在审核中!</span>
                        </div>
                        <div class="CollectMes" v-if="userInfo.store_status==3">
                            <span>您的店铺审核失败，请前往消息查看中心查看原因</span>
                            <button>
                                <a :href="'{{route('home.suppliermy.supplierStoreEdit') }}?id='+userInfo.store_id">修改</a>
                            </button>
                        </div>
                        <div class="CollectMes" v-if="userInfo.store_status==4">
                            <span>您的店铺已下架，请前往消息查看中心查看原因</span>
                            <button>
                                <a :href="'{{route('home.suppliermy.supplierStoreEdit') }}?id='+userInfo.store_id">修改</a>
                            </button>
                        </div>
                    </div>
                    <div class="CollectMes" v-else>
                        <span>您还未拥有自己的店铺，请创建属于自己的店铺</span>
                        <button>
                            <a href="{{route('home.suppliermy.supplierStoreEdit')}}">
                                创建店铺
                            </a>
                        </button>
                    </div>
                </div>
                <div class="myProperty">
                    <div class="myTitle">
                        <div><span></span>我的活动</div>
                        <a href="{{route('home.suppliermy.supplierAct')}}">活动管理中心 ></a>
                    </div>
                    <div class="CollectMes">
                        <!-- <a href="">
                            <span>999+</span>
                            <span>已发布</span>
                        </a> -->
                        <a>
                            <span>@{{userInfo.act_sign_up || 0}}</span>
                            <span>进行中</span>
                        </a>
                        <a>
                            <span>@{{userInfo.act_finish || 0}}</span>
                            <span>已完结</span>
                        </a>
                        <button>
                            <a href="{{route('home.activity.actAdd')}}">
                                发布活动
                            </a>
                        </button>
                    </div>
                </div>
            </div>
            <div class="myPropertys">
            <div class="myProperty">
                    <div class="myTitle">
                        <div><span></span>我的投标</div>
                        <a href="{{route('home.suppliermy.supplierBidding')}}">竞标管理中心 ></a>
                    </div>
                    <div class="CollectMes">
                        <a>
                            <span>@{{userInfo.bidding || 0}}</span>
                            <span>已投标</span>
                        </a>
                        <a>
                            <span>@{{userInfo.winning_bid || 0}}</span>
                            <span>已中标</span>
                        </a>
                        <!-- <a>
                            <span>@{{userInfo.winning_bid}}</span>
                            <span>已完成</span>
                        </a> -->
                        <button>
                            <a href="{{route('home.demand.demandList')}}">
                                去投标
                            </a>
                        </button>
                    </div>
                </div>
                <div class="myProperty">
                    <div class="myTitle">
                        <div><span></span>我的商品</div>
                        <a v-if="userInfo.store_status==1" href="{{route('home.suppliermy.supplierGoods')}}">商品管理中心 ></a>
                    </div>
                    <div class="CollectMes" v-if="userInfo.store_status==1">
                        <a>
                            <span>@{{userInfo.goods_num || 0}}</span>
                            <span>上架商品</span>
                        </a>
                        <a>
                            <span>@{{userInfo.goods_collect || 0}}</span>
                            <span>收藏量</span>
                        </a>
                        <a style="cursor: pointer;" href="{{route('home.suppliermy.supplierOrder')}}">
                            <span>@{{userInfo.goods_salenum || 0}}</span>
                            <span>成交量</span>
                        </a>
                        <button>
                            <a href="{{route('home.suppliermy.supplierGoodsUpdate')}}">
                                发布商品
                            </a>
                        </button>
                    </div>
                    <div class="CollectMes" v-else>
                        <span>您还未拥有自己的店铺，不能发布商品，请创建店铺后发布</span>
                    </div>
                </div>
            </div>
            <div class="myFootprint">
                <div class="myTitle">
                    <div><span></span>我的足迹</div>
                    <!-- <a href="{{route('home.hrmy.hrFootprint')}}">查看更多 ></a> -->
                </div>
                <div class="footprintMian" v-for="(item,index) in footprint">
                    <!-- 供应商 -->
                    <div class="footprint_store" v-if="item.type==1">
                        <img :src="item.store.logo">
                        <div>
                            <p class="footprint_title">
                                <span class="footprint_name">@{{item.store.store_name}}
                                    <img v-if="item.store.quality==2" src="{{URL::asset('./img/icon/storeColloct.png')}}">
                                    <img v-if="item.store.hot==2" src="{{URL::asset('./img/icon/storeHot.png')}}">
                                </span>
                                <span class="browseTime"> 浏览于<span>
                                        @{{item.created_at}}
                                    </span></span>
                            </p>
                            <p class="footprint_1">
                                <span>
                                    <span style="margin-right: 3px;">浏览量</span>
                                    @{{item.store.view}}
                                </span>
                                <span>
                                    <span style="margin-right: 3px;">来电咨询</span>
                                    @{{item.store.call}}
                                </span>
                                <span>
                                    <span style="margin-right: 3px;">好评</span>
                                    @{{item.store.credit}}%
                                </span>
                                {{--<span style="color:#333333">--}}
                                    {{--<img src="{{URL::asset('./img/icon/storeListTel.png')}}">--}}
                                    {{--@{{item.store.call}}--}}
                                {{--</span>--}}
                                {{--<span>--}}
                                    {{--<img src="{{URL::asset('./img/icon/storeListNote.png')}}">--}}
                                    {{--@{{item.store.service}}--}}
                                {{--</span>--}}
                                {{--<span>--}}
                                    {{--<img src="{{URL::asset('./img/icon/storeListEye.png')}}">--}}
                                    {{--@{{item.store.view}}--}}
                                {{--</span>--}}
                                {{--<span>--}}
                                    {{--<img src="{{URL::asset('./img/icon/storeListZan.png')}}">--}}
                                    {{--@{{item.store.praise}}--}}
                                {{--</span>--}}
                            </p>
                            <p>
                                @{{item.store.service_scope}}
                        </div>
                        <button @click=" window.location.href = '{{ route('home.store.store') }}?id='+item.store.id">
                            查看详情
                        </button>
                    </div>
                    <!-- 产品 -->
                    <div class="footprint_goods" v-if="item.type==3">
                        <img :src="item.goods.thumb">
                        <div>
                            <p class="footprint_title">
                                <span class="footprint_name">@{{item.goods.title}}
                                </span>
                                <span class="browseTime"> 浏览于<span>
                                        @{{item.created_at}}
                                    </span></span>
                            </p>
                            <p class="footprint_goodsMes">
                                @{{item.goods.description}}
                            </p>
                            <p class="footprint_goodsFooter">
                                <span v-if="item.goods.type!=3">
                                    <span style="margin-right: 3px;color: red;">价格</span>
                                    <span style="color: red;" v-if="item.goods.price!=0.00">￥@{{item.goods.price}}</span>
                                    <span style="color: red;" v-else>免费</span>
                                </span>
                                <span v-else>
                                    <span style="margin-right: 3px;color: red;">价格</span>
                                    <span style="color: red;" v-if="item.goods.price!=0.00">@{{item.goods.price}} 积分</span>
                                    <span style="color: red;" v-else>免费</span>
                                </span>
                                <span>
                                    <span style="margin-right: 3px;">成交量</span>
                                    @{{item.goods.salenum}}
                                </span>
                                <span>
                                    <span style="margin-right: 3px;">浏览量</span>
                                    @{{item.goods.view}}
                                </span>
                                <span>
                                    <span style="margin-right: 3px;">好评</span>
                                    @{{item.goods.credit}}%
                                </span>


                                {{--<span>--}}
                                    {{--<img src="{{URL::asset('./img/icon/storeListEye.png')}}">--}}
                                    {{--@{{item.goods.salenum}}--}}
                                {{--</span>--}}
                                {{--<a v-if="item.goods.type!=3">--}}
                                    {{--<span v-if="item.goods.price!=0.00">--}}
                                        {{--￥@{{item.goods.price}}--}}
                                    {{--</span>--}}
                                    {{--<span v-else>--}}
                                        {{--免费--}}
                                    {{--</span>--}}
                                {{--</a>--}}
                                {{--<a v-else>--}}
                                    {{--<span v-if="item.goods.price!=0.00">--}}
                                        {{--@{{item.goods.price}}积分--}}
                                    {{--</span>--}}
                                    {{--<span v-else>--}}
                                        {{--免费--}}
                                    {{--</span>--}}
                                {{--</a>--}}
                            </p>
                        </div>
                        <button @click=" window.location.href = '{{ route('home.goods.goodsDetails') }}?goodsId='+item.goods.id+'&type='+item.goods.type">
                            查看详情
                        </button>
                    </div>
                    <!-- 活动 -->
                    <div class="footprint_activity" v-if="item.type==4">
                        <img :src="item.act.thumb">
                        <div>
                            <p class="footprint_title">
                                <span class="footprint_name">@{{item.act.title}}
                                </span>
                                <span class="browseTime"> 浏览于<span>
                                        @{{item.created_at}}
                                    </span></span>
                            </p>
                            <p class="footprint_activityMes">
                                <span>
                                    <span style="margin-right: 3px;color: red;">价格</span>
                                    <span style="color: red;">@{{item.act.cost}}</span>
                                    <span style="padding: 0 2px;background: #ffa531;margin-left: 3px;border-radius: 2px;color: #fff; " v-if="item.act.act_state!='报名结束'">报名中</span>
                                    <span style="padding: 0 2px;background: #ccc;margin-left: 3px;border-radius: 2px;color: #fff; " v-else>报名结束</span>
                                </span>
                                <span>
                                    <span style="margin-right: 3px;">已报名</span>
                                    @{{item.act.number}}
                                </span>
                                <span>
                                    <span style="margin-right: 3px;">活动时间</span>
                                    @{{item.act.start_at}}
                                </span>

                                {{--<span>--}}
                                    {{--<img src="{{URL::asset('./img/icon/storeListEye.png')}}">--}}
                                    {{--@{{item.act.view}}--}}
                                {{--</span>--}}
                                {{--<span>--}}
                                    {{--<img src="{{URL::asset('./img/icon/child.png')}}">--}}
                                    {{--@{{item.act.number}}--}}
                                {{--</span>--}}
                                {{--<span>--}}
                                    {{--<img src="{{URL::asset('./img/icon/monyred.png')}}">--}}
                                    {{--@{{item.act.cost}}--}}
                                {{--</span>--}}
                                {{--<span>--}}
                                    {{--<img src="{{URL::asset('./img/icon/timeyellow.png')}}">--}}
                                    {{--@{{item.act.start_at}}--}}
                                {{--</span>--}}
                            </p>
                        </div>
                        <button @click=" window.location.href = '{{ route('home.activity.actDetails') }}?cateId='+item.act.id">
                            查看详情
                        </button>
                    </div>
                    <!-- 文档 -->
                    <div class="footprint_word" v-if="item.type==5">
                        <img :src="item.word.thumb">
                        <div>
                            <p class="footprint_title">
                                <span class="footprint_name">@{{item.word.title}}
                                </span>
                                <span class="browseTime"> 浏览于<span>
                                        @{{item.created_at}}
                                    </span></span>
                            </p>
                            <p class="footprint_wordMes footprint_activityMes">
                                <span>
                                    <span style="margin-right: 3px;">浏览</span>
                                    @{{item.word.view}}
                                </span>
                                <span>
                                    <span style="margin-right: 3px;">下载</span>
                                    @{{item.word.download}}
                                </span>
                                <span>
                                    <span style="margin-right: 3px;">格式</span>
                                    <span v-if="item.word.format=='doc'">doc</span>
                                    <span v-if="item.word.format=='docx'">docx</span>
                                    <span v-if="item.word.format=='ppt'">ppt</span>
                                    <span v-if="item.word.format=='pdf'">pdf</span>
                                    <span v-if="item.word.format=='xlsx'">xlsx</span>
                                    <span v-if="item.word.format=='xls'">xls</span>
                                </span>

                                {{--<span>--}}
                                    {{--<img src="{{URL::asset('./img/icon/storeListEye.png')}}">--}}
                                    {{--@{{item.word.view}}--}}
                                {{--</span>--}}
                                {{--<span>--}}
                                    {{--<img src="{{URL::asset('./img/icon/download.png')}}">--}}
                                    {{--@{{item.word.download}}--}}
                                {{--</span>--}}
                                {{--<span>--}}
                                    {{--<img src="{{URL::asset('./img/icon/time.png')}}">--}}
                                    {{--@{{item.word.created_at}}--}}
                                {{--</span>--}}
                                {{--<span>--}}
                                    {{--<img v-if="item.word.format=='doc' || item.word.format=='docx'" src="{{URL::asset('./img/icon/downWord.png')}}">--}}
                                    {{--<img v-if="item.word.format=='ppt'" src="{{URL::asset('./img/icon/downPPT.png')}}">--}}
                                    {{--<img v-if="item.word.format=='pdf'" src="{{URL::asset('./img/icon/downPdf.png')}}">--}}
                                    {{--<img v-if="item.word.format=='xlsx' || item.word.format=='xls'" src="{{URL::asset('./img/icon/downExel.png')}}">--}}
                                {{--</span>--}}
                            </p>
                        </div>
                        <button @click=" window.location.href = '{{ route('home.word.wordDetails') }}'">
                            查看详情
                        </button>
                    </div>
                    <!-- 需求 -->
                    <div class="footprint_demand" v-if="item.type==2">
                        <el-tooltip class="item" effect="dark" :content="item.demand.price+'万'" placement="top-start">
                            <span class="itemMone">
                                <a>
                                    ￥
                                </a>@{{item.demand.price}}万
                            </span>
                        </el-tooltip>
                        <div>
                            <p class="footprint_title">
                                <span class="footprint_name">@{{item.demand.title}}
                                    <img v-if="item.demand.urgent==2" src="{{URL::asset('./img/icon/urgent.png')}}">
                                </span>
                                <span class="browseTime"> 浏览于<span>
                                        @{{item.created_at}}
                                    </span></span>
                            </p>

                            <p>@{{item.demand.content}}</p>
                            <p class="footprint_demandFooter">
                                <span>
                                    <a>
                                        @{{item.demand.number}}
                                    </a>
                                    竞标

                                </span>
                                <span>
                                    <a>
                                        @{{item.demand.created_at}}
                                    </a>
                                    发布
                                </span>
                                <span>
                                    <a>
                                        @{{item.demand.end_at}}
                                    </a>
                                    截止
                                </span>
                            </p>
                        </div>
                        <button @click=" window.location.href = '{{ route('home.demand.demandSupplierDetails') }}?demandId='+item.demand.id">
                            查看详情
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
@section('compontentScipts')
<script>
    $(() => {

        let supplierIndex = new Vue({
            el: '#supplierIndexs',
            data: () => {
                return {
                    userInfo: {
                        profit:0,
                        contract:0
                    },
                    footprint: [],
                }
            },
            created() {
                this.getData();
            },
            mounted() {},
            methods: {
                getData() {
                    let data = {}
                    apiAjax("{{ route('home.user.userInfoApi')}}", 'get', data, (res) => {
                        if (res.code == 0) {
                            this.userInfo = res.data;
                            sessionStorage.setItem("HRuserDetails", JSON.stringify(res.data))
                            for (let index in res.data.footprint){
                                if(index.store!=""){
                                    console.log(1)
                                    this.footprint = res.data.footprint;
                                }
                            }
                        } else {
                            this.$message({
                                message: res.msg,
                                type: 'warning'
                            });
                        }
                    }, (erro) => {

                    });
                },
            }
        })
    })
</script>
@endsection